with Cairo, Cairo.Surface;
with SDL, SDL.Video;
with Interfaces.C;
package CairoSDL is
   use Interfaces.C;

   subtype Float_Color is double range 0.0 .. 1.0;
--   with Static_Predicate => Float_Color >= 0.0 and Float_Color <= 1.0;

   type Cairo_Color_Type is record
      R, G, B, A : Float_Color := 1.0; 
   end record;

   function To_Cairo (C : SDL.Video.Color_t) return Cairo_Color_Type;

   function To_Cairo (R : SDL.Video.Rect_t) return Cairo.Cairo_Rectangle;

   function New_Cairo_Surface (
      Source : SDL.Video.Surface_Access_t
      ) return Cairo.Surface_Ptr;

   procedure Flush (cr : Cairo.Surface_Ptr);

   procedure Mark_Dirty (cr : Cairo.Surface_Ptr);

private
   pragma Import(C, New_Cairo_Surface, "cairosdl_surface_create");
   pragma Import(C, Flush, "cairosdl_surface_flush");
   pragma Import(C, Mark_Dirty, "cairosdl_surface_mark_dirty");
end CairoSDL;
